//
//  RealityHeader.m
//  敢唆嘛!
//
//  Created by 教主 on 15/11/28.
//  Copyright © 2015年 zms. All rights reserved.
//

#import "RealityHeader.h"
#include "Device.h"

@interface RealityHeader ()
@property(nonatomic , strong)UILabel *newerLabel;//最新
@property(nonatomic , strong)UILabel *hotLabel;//最热

@end

@implementation RealityHeader
{
    CGFloat height;
}

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self)
    {
        height = KSHeight/1.75;
        //    表头总视图
        UIView *headerView = [[UIView alloc]init];
        headerView.backgroundColor = [UIColor whiteColor];
        
        UIView *grayView = [[UIView alloc]initWithFrame:CGRectMake(KSWidth/4, height/35, KSWidth/2, height/12)];
        grayView.backgroundColor = [UIColor grayColor];
        grayView.alpha = 0.4;
        grayView.layer.cornerRadius = height/24;
        
        
        
        //    最新
        self.newerLabel = [[UILabel alloc]initWithFrame:CGRectMake(KSWidth/14, 0, KSWidth/5, height/12)];
        self.newerLabel.text = @"最新";
        self.newerLabel.font = [UIFont systemFontOfSize:15];
        self.newerLabel.textColor = [UIColor blackColor];
        [grayView addSubview:self.newerLabel];
        
        //    最热
        self.hotLabel = [[UILabel alloc]initWithFrame:CGRectMake(KSWidth/3, 0, KSWidth/5, height/12)];
        self.hotLabel.text = @"最热";
        self.hotLabel.font = [UIFont systemFontOfSize:15];
        self.hotLabel.textColor = [UIColor blackColor];
        [grayView addSubview:self.hotLabel];
        
        // 标题
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(KSWidth/4, height/8, KSWidth/2, height/15)];
        
        self.titleLabel.font = [UIFont systemFontOfSize:11];
        self.titleLabel.textColor = [UIColor grayColor];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [headerView addSubview:_titleLabel];
        [self.contentView addSubview:headerView];
        
        //    白色滑动视图
        self.whiteView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KSWidth/4, height/12)];
        self.whiteView.layer.cornerRadius = height/24;
        self.whiteView.backgroundColor = [UIColor whiteColor];
        self.whiteView.alpha = 0.5;
        [grayView addSubview:self.whiteView];
        
        [self.contentView addSubview:grayView];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
